import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TreeSet;
import java.util.logging.SimpleFormatter;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Regex {
    public static void main(String[] args) {
        String str="192.168.0.156     61.37.69.69 192.168.1.126    127.0.0.1";
        str=str.replaceAll("(\\d+)","00$1");
        str=str.replaceAll("0*(\\d{3})","$1");
        String[] sli = str.split(" +");
        TreeSet<String> ts = new TreeSet<>();
        for (String ip : sli){
            ts.add(ip);
        }
        for (String ip : ts){
            String finalIp=ip.replaceAll("0*(\\d+)","$1");
            System.out.println(finalIp);
        }
        Calendar calendar = Calendar.getInstance();
        Date date = calendar.getTime();
        calendar.setTime(date);
        calendar.add(Calendar.DAY_OF_MONTH, 30);
        SimpleDateFormat ft = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
        System.out.println(ft.format(calendar.getTime()));
        long d = (long) (((1998 - 1970) *365+27)*24-8)*3600*1000;
        Date date1=new Date(d);
        calendar.setTime(date1);
        System.out.println(ft.format(calendar.getTime()));
//        String regex="\\d+";
//        Pattern p=Pattern.compile(str);
//        Matcher m=p.matcher(str);
    }
}
